home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 17
/
AMIGAplus Sonderheft 17 (1999)(ICP)(DE)[!].iso
/
PD
/
Anwendungen
/
-DataTypes-
/
mpegaudio
/
mpegaudio.datatype.doc
< prev
next >
Wrap
Text File
|
1998-06-17
|
9KB
|
267 lines
TABLE OF CONTENTS
mpegaudio.datatype/--datasheed--
mpegaudio.datatype/--input_format--
mpegaudio.datatype/DTM_WRITE
mpegaudio.datatype/MAIN
mpegaudio.datatype/OM_DISPOSE
mpegaudio.datatype/OM_NEW
mpegaudio.datatype/--datasheed-- mpegaudio.datatype/--datasheed--
NAME
mpegaudio.datatype -- data type for MPEG audio streams
SUPERCLASS
sound.datatype
DESCRIPTION
The mpegaudio.datatype, a sub-class of the sound.datatype, is
used to load and save MPEG audio streams using "maplay" / "mpega"
and the 8SVX/AIFF datatype.
METHODS
OM_NEW -- Create a new sound object from a description file. The
source may only be a file. An empty object (DTST_RAM) can
also be created (unless the project was compiled with
the NO_ENCODER flag).
OM_UPDATE -- Perform an ICM_CHECKLOOP check, and if succesfull, the
method will be executed like OM_SET downstairs.
OM_SET -- Pass msg to superclass and call GM_RENDER if retval from
superclass was != 0UL.
DTM_WRITE -- Save data in local (MPEG audio) or superclass (IFF 8SVX)
format.
Local format has not been implemented yet.
All other methods are passed unchanged to superclass.
ATTRIBUTES
Following attributes are set by the object and are READ-ONLY for
applications (if the datatype is used for saving (e.g. the
application creates an empty mpegaudio.datatype object and fills
in some required atrributes as shown in the "DTConvert" example),
these attributes are used by the encoder to create a MPEG audio
sound file):
DTA_ObjName -- Set by DTA_Name's value.
SDTA_VoiceHeader -- Copy from the embedded 8svx/aiff.datatype
object
SDTA_Sample -- 8 bit sample data
SDTA_SampleLength -- length of 8 bit sample data
SDTA_Volume -- volume (got from the voiceheader)
SDTA_Period -- created from (VoiceHeader -> vh_SamplesPerSec)
and system's clock
BUGS
The project has been not very well tested yet. Therefore...
... no known bugs.
TODO
- Fixing the bugs above
- Support for SDTM_LOADFRAME / SDTM_UNLOADFRAME (implies also support
for 16-bit audio á la RTA / AHI).
- Encoder support (e.g. DTM_WRITE).
HISTORY
V1.1
First public release.
V1.2
- Swichted to Stephane Tavenard's "mpega".
(Have gave me the tip how to get in sync with the video (using
the options -b 1 -t 0).
Thank you very much Stephane !
- Small code cleanup (the class dispatcher is now a static
function etc.)
V2.1
- Swichted to Stephane Tavenard's "mpega.library".
Thank you very much Stephane !
V2.2
- Now stero files are decoded with both left+right channel instead
the left channel only.
- Reduced the decoder's buffer size from 2048 down to 1024 bytes
to get a much more accurate lip sync if used within
mpegsystem.datatype (for tests only...).
SEE ALSO
sound.datatype
mpegaudio.datatype/--input_format-- mpegaudio.datatype/--input_format--
NAME
MPEG audio --
DESCRIPTION
<not written yet>
SEE ALSO
mpegaudio.datatype/DTM_WRITE mpegaudio.datatype/DTM_WRITE
NAME
DTM_WRITE -- Save data
FUNCTION
This method saves the object's contents to disk.
If dtw_Mode is DTWM_IFF, the method is passed unchanged to the
superclass, sound.datatype, which writes an IFF 8SVX sample.
If dtw_mode is DTWM_RAW, the object writes a MPEG audio stream to
the filehandle given.
(If the class library was compiled with the NO_ENCODER switch
(not the default), result == 0 and resul2 == ERROR_NOT_IMPLEMENTED
are returned).
TAGS
None defined.
RESULT
Returns 0 for failure (IoErr() returns result2), non-zero
for success.
mpegaudio.datatype/MAIN mpegaudio.datatype/MAIN
INTRODUCTION
Datatypes class for MPEG audio streams.
REQUIREMENTS
- You need at least Kick/WB 3.0.
- mc68020 (required by the "mpega" decoder).
This datatype checks the CPU installed and rejects any attempt to
open it if the CPU is not available.
- "datatypes/sound.datatype", >= V39.
USAGE
If the datatypes descriptor file was activated, any attempt to load
a MPEG audio stream using GMultiView, MultiView, AmigaGuide or
SwitchWindow will load and play the sample.
If you want to save the current sample in mpegaudio.datatype's local
format, use MultiView's "Project/Save As..." menu (or GMultiView's
"Project/Save As Raw...").
(NOT IMPLEMENTED YET)
INSTALLATION
After unpacking this archive:
Because this version does not include an Installer script, you have
to do the installation manually through the shell:
- Unpack this archive and copy the "mpegaudio.datatype" to
SYS:Classes/DataTypes:
Copy CLONE FROM "mpegaudio.datatype" TO
"SYS:Classes/DataTypes/mpegaudio.datatype"
- Then copy the datatypes descriptor into the DEVS:DataTypes
directory.
If the descriptor already exists, you should not replace it,
otherwise you may loose "toolnodes" and other settings stored in
the existing descriptor.
Copy CLONE FROM "MPEG Audio(%|.info)" TO DEVS:Datatypes/
NOTE
The datatype "hooks" on an external mpeg audio decoder like "mpega".
SOURCE
Source is fully included here.
AUTHOR
If you want to blame me, report any bugs, or wants a new version
send your letter to:
Roland Mainz
Hohenstaufenstraße 8
52388 Nörvenich
GERMANY
Phone: (+49)(0)2426/901568
Fax: (+49)(0)2426/901569
EMAIL is also available (if you want to send me attachments
larger than 1MB (up to 5MB, more with my permission):
GISBURN@w-specht.rhein-ruhr.de
Up to August 1998 I'm reachable using this email address, too:
Reinhold.A.Mainz@KBV.DE
| Please put your name and address in your mails !
| German mailers should add their phone numbers.
| See BUGS section above when submitting bug reports.
Sorry, but I can only look once a week for mails.
If you don't hear something from me within three weeks, please
send your mail again (but watch about new releases) (problems with
this email port are caused by reconfigurations, hackers, network
problems etc.).
The entire "mpegaudio.datatype" package may be noncommercially
redistributed, provided that the package is always distributed
in it's complete form (including it's documentation). A small
copy fee for media costs is okay but any kind of commercial
distribution is strictly forbidden without my permission !
Comments and suggestions how to improve this program are
generally appreciated!
Thanks to David Junod, who wrote the datatypes environment and lots
of the datatypes example code, Matt Dillon for his DICE, Olaf
'Olsen' Barthel for his help, ideas and some text clips from his
documentations.
mpegaudio.datatype/OM_DISPOSE mpegaudio.datatype/OM_DISPOSE
NAME
OM_DISPOSE -- Delete object
FUNCTION
Frees the contents of the mpegvideo.datatype instance data
and passes then the msg to the superclass.
RESULT
Returns 0 evertimes.
mpegaudio.datatype/OM_NEW mpegaudio.datatype/OM_NEW
NAME
OM_NEW -- Create a mpegaudio.datatype object.
FUNCTION
The OM_NEW method is used to create an instance of the
mpegaudio.datatype class. This method is passed to the superclass
first. After this, mpegaudio.datatype loads the sample using
"mpega.library"'s decoder into memory.
ATTRIBUTES
The following attributes can be specified at creation time.
DTA_SourceType (ULONG) -- Determinates the type of DTA_Handle
attribute. Only DTST_FILE is supported.
If any other type was set in a given DTA_SourceType,
OM_NEW will be rejected.
Defaults to DTST_FILE.
DTA_Handle -- For DTST_FILE, a BPTR to a lock is expected by
datatypesclass, which will convert this into a filehandle.
A DTST_RAM (create empty object) source type requires a NULL
handle.
NOTE
If the datatype was compiled with the NO_ENCODER flag set,
DTA_SourceType == DTST_RAM causes OM_NEW to reject the method.
RESULT
If the object was created a pointer to the object is returned,
otherwise NULL is returned.